var SkyModel = function() {
	var self = this;
	this.loaded = new signals.Signal();
	this.data = [];

 	this.init = function() {
 		// console.log('[SkyModel] Loading stars..')
 		try {
 			$.ajax({
 				type: "GET",
 				url:URLBASE+'/stars/',
 				contentType: 'application/json',
 				dataType: 'json'
 			}).error(function(e) { 
 				console.log("[SkyModel] init error", e)
 			}).done(function (data) {
 				// console.log("[SkyModel] Stars loaded", data.length)

 				for (var i = 0; i < data.length; i++) {
 					var s = new StarItem()
 					s.id = data[i].id
 					s.x = data[i].x
 					s.y = data[i].y
 					self.data.push(s)
 				};
 				self.loaded.dispatch(self.data)

 			});
 		} catch(e) {
 			console.log("[SkyModel]  error", e)
 		}
 	}

 	
    return this

}
